package com.khbr.employee_imfo.service.impl;
import com.khbr.employee_imfo.dao.IEmployeeDao;
import com.khbr.employee_imfo.dao.impl.EmployeeDao;
import com.khbr.employee_imfo.entity.Employee;
import com.khbr.employee_imfo.model.Condition;
import com.khbr.employee_imfo.model.PageDepart;
import com.khbr.employee_imfo.service.IEmployeeService;

import java.util.ArrayList;
import java.util.List;
/**
 * Created by John.C on 2018/11/29.
 */
public class EmployeeService implements IEmployeeService{
    IEmployeeDao employeeDao=new EmployeeDao();
    @Override
    public void create(Employee employee) {
        employeeDao.create(employee);
    }

    @Override
    public void delete(int id) {
        employeeDao.delete(id);
    }

    @Override
    public void update(Employee employee) {
        employeeDao.update(employee);
    }

    @Override
    public Employee find(int id) {
        Employee employee=employeeDao.find(id);
        return employee;
    }

    @Override
    public List<Employee> multipleFind(PageDepart pageDepart, Condition condition) {
        List<Employee> list=new ArrayList<>();
        list=employeeDao.multipleFind(pageDepart,condition);
        return list;
    }

    @Override
    public int count(Condition condition){
        int cont=employeeDao.count(condition);
        return cont;
    }
}